﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DigitalRubyShared;

public class LevelSmall2Big : MonoBehaviour
{
    public GameObject loveObject;
    private ScaleGestureRecognizer scaleGesture;

    public GameLevelItem gameLevelItem;
    // Start is called before the first frame update
    void Start()
    {
        scaleGesture = new ScaleGestureRecognizer();
        scaleGesture.StateUpdated += RotateGestureCallback;
        FingersScript.Instance.AddGesture(scaleGesture);
    }

    // Update is called once per frame
    void Update()
    {


    }

    private void RotateGestureCallback(DigitalRubyShared.GestureRecognizer gesture)
    {

        Debug.Log(gesture.State.ToString());
        if (gesture.State == GestureRecognizerState.Executing)
        {
            if (scaleGesture.ScaleMultiplier > 1)
            {
                loveObject.transform.localScale *= scaleGesture.ScaleMultiplier;
            }
        }
        

        if (loveObject.transform.localScale.x > 2)
        {
            loveObject.transform.localScale = Vector3.one * 2;
            FingersScript.Instance.RemoveGesture(scaleGesture);
            gameLevelItem.TriggerResult(true);
        }



    }

}
